import Mock from "mockjs";
const Random = Mock.Random;
export const mocktransactionrecords = function () {
  let list = [];
  for (let i = 0; i < Random.integer(4, 6); i++) {
    var record = Mock.mock({
      model: "UserSubSystem.transactionRecord",
      "pk": i+1,
      fields: {
        //生成随机的交易操作类型
        "operate_type|1":["转入","转出"],
        //生成随机的交易金额
        "transaction_amount|100-10000.1-2": 100.1,
        //生成随机的交易操作时间
        operate_time: "@datetime('yyyy-MM-dd hh:mm:ss')",
        //生成随机的完成操作时间
        operate_finish_time :"@datetime('yyyy-MM-dd hh:mm:ss')",
        //生成随机的交易操作状态
        "operate_state|1":["进行中","已完成","取消"],
        //生成随机的交易来源/去向
        "transaction_source|1":["余额","中国银行","中国工商银行"],
      },
    });
    list.push(record);
  }
  return {
    data: JSON.stringify(list),
    flag: true,
  };
};
